package roslan.musicbox.utils;

import java.io.UnsupportedEncodingException;

public class StringEncodingTool {
	public static String encode(String str, String oriCharset,
								String newCharset) 
	throws UnsupportedEncodingException{
		if (str == null) return null;
		if(str.isEmpty()) return "";
		byte[] byteArr = str.getBytes(oriCharset);
		return new String(byteArr, newCharset);
	}

}
